home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / laptop-mode-tools / module-helpers / pm-helper < prev    next >
Encoding:
Text File  |  2012-05-20  |  381 b   |  29 lines

  1. #!/bin/sh
  2.  
  3.  
  4. MEM=0;
  5. DISK=0;
  6.  
  7. target=`basename $0 | cut -d '-' -f2`
  8.  
  9.  
  10. case "$target" in
  11.     suspend) MEM=1 ;;
  12.     hibernate) DISK=1 ;;
  13.     *) echo "Unrecognized command"
  14.          exit 1 ;;
  15. esac
  16.     
  17. # Sync buffers first.
  18. sync;
  19.  
  20. # Freezer on preference
  21. if [ x$MEM = x1 ]; then
  22.     echo "mem" > /sys/power/state
  23. elif [ x$DISK = x1 ]; then
  24.     echo "disk" > /sys/power/state
  25. else
  26.     ## Nothing to do.
  27.     echo ;
  28. fi
  29.